package com.polaris.live.dialog

import android.content.Context
import android.view.ViewGroup
import com.blankj.utilcode.util.StringUtils
import com.lxj.xpopup.core.BottomPopupView
import com.polaris.live.R
import com.polaris.live.common.util.NavigationBarUtils
import com.polaris.live.databinding.DialogAdministratorIllustrateBinding
import com.polaris.live.translation.R.string

/**
 * 管理员列表
 *
 * @author Created by 半仙 on 2024/5/30/030 11:40
 */
class AdministratorIllustrateDialog(context: Context, private val maxCount: Long) : BottomPopupView(context) {
    override fun getImplLayoutId(): Int {
        return R.layout.dialog_administrator_illustrate
    }

    private lateinit var mBinding: DialogAdministratorIllustrateBinding

    override fun onCreate() {
        super.onCreate()
        mBinding = DialogAdministratorIllustrateBinding.bind(popupImplView)

        mBinding.tvAdministratorNum.text = StringUtils.getString(string.administrator_num_detail, "$maxCount")

        NavigationBarUtils.setNavigationHeightIfTransparent(mBinding.vLine) { view, height ->
            val layoutParams = view.layoutParams as ViewGroup.LayoutParams
            layoutParams.height = height
            mBinding.vLine.layoutParams = layoutParams
        }
    }

}